import { Component, OnInit, Output, EventEmitter } from '@angular/core';

import { SheBaoService } from '../../services/shebao.service';
import { ISheBao } from '../../commons/shebao';

@Component({
    selector: 'setting-component',
    templateUrl: './setting.component.html',
    styleUrls: ['./setting.component.css']
})
export class SettingComponent implements OnInit {

    public settings: ISheBao;

    @Output()
    public change = new EventEmitter<any>();

    constructor(private shebaoService: SheBaoService) { }

    public ngOnInit() {
        this.settings = this.shebaoService.rate;
    }

    /**
     * 社保改变后通知服务修改默认社保值
     */
    public settingChanged() {
        this.change.emit();
    }

}